#ifndef _QUEUE_H
#define _QUEUE_H

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

#define Object Data_th
#define ERROR -99 //Object的特殊值，标志错误

typedef struct
{
    float t;
    float h;
    uint64_t time;
} Data_th;

typedef struct Node
{
    Object data;
    struct Node *next;
} QNode;

typedef struct
{
    QNode *front; //指向对头节点
    QNode *rear;  //指向队尾节点
    uint16_t size_max;
    uint16_t size_current;

} Queue;

Queue *CreateQueue(uint16_t size);
void AddQ(Queue *q, Object item);
int DeleteQ(Queue *q);

#endif